package com.surfacing.rcp.client.editors;

import org.eclipse.jface.layout.TableColumnLayout;
import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.TabFolder;
import org.eclipse.swt.widgets.TabItem;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.part.ViewPart;

public class DienststelleView extends ViewPart {

	public static final String ID = "com.surfacing.rcp.ui.views.DienststelleView";
	private Text inputSearchEa;
	private Text inputCreateEa;
	private Table table;

	public DienststelleView() {
	}

	@Override
	public void createPartControl(Composite parent) {
		parent.setLayout(new GridLayout(1, false));

		TabFolder tabFolder = new TabFolder(parent, SWT.NONE);
		GridData gd_tabFolder = new GridData(SWT.CENTER, SWT.TOP, false, false,
				1, 1);
		gd_tabFolder.heightHint = 76;
		tabFolder.setLayoutData(gd_tabFolder);

		TabItem tabSearchItem = new TabItem(tabFolder, SWT.NONE);
		tabSearchItem.setText("Suche");

		Group group = new Group(tabFolder, SWT.NONE);
		tabSearchItem.setControl(group);
		group.setLayout(new GridLayout(11, false));

		Label lblNachname = new Label(group, SWT.NONE);
		lblNachname.setSize(58, 15);
		lblNachname.setText("Suche");

		inputSearchEa = new Text(group, SWT.BORDER);
		GridData gd_inputSearchTpo = new GridData(SWT.LEFT, SWT.CENTER, false,
				false, 1, 1);
		gd_inputSearchTpo.widthHint = 200;
		inputSearchEa.setLayoutData(gd_inputSearchTpo);
		inputSearchEa.setSize(76, 21);
		new Label(group, SWT.NONE);
		new Label(group, SWT.NONE);
		new Label(group, SWT.NONE);
		new Label(group, SWT.NONE);
		new Label(group, SWT.NONE);
		new Label(group, SWT.NONE);
		new Label(group, SWT.NONE);
		new Label(group, SWT.NONE);

		Button btnSearchEa = new Button(group, SWT.NONE);
		GridData gd_btnSearchTpo = new GridData(SWT.LEFT, SWT.CENTER, false,
				false, 1, 1);
		gd_btnSearchTpo.widthHint = 100;
		btnSearchEa.setLayoutData(gd_btnSearchTpo);
		btnSearchEa.setSize(44, 25);
		btnSearchEa.setText("Suche");

		TabItem tabNewEa = new TabItem(tabFolder, SWT.NONE);
		tabNewEa.setText("Neue Dienststelle");

		Group group_1 = new Group(tabFolder, SWT.NONE);
		tabNewEa.setControl(group_1);
		group_1.setLayout(new GridLayout(11, false));

		Label lblEinsatzart = new Label(group_1, SWT.NONE);
		lblEinsatzart.setText("Dienststelle");
		lblEinsatzart.setBounds(0, 0, 48, 15);

		inputCreateEa = new Text(group_1, SWT.BORDER);
		GridData gd_inputCreateTpo = new GridData(SWT.LEFT, SWT.CENTER, false,
				false, 1, 1);
		gd_inputCreateTpo.widthHint = 200;
		inputCreateEa.setLayoutData(gd_inputCreateTpo);
		inputCreateEa.setBounds(0, 0, 212, 21);
		new Label(group_1, SWT.NONE);
		new Label(group_1, SWT.NONE);
		new Label(group_1, SWT.NONE);
		new Label(group_1, SWT.NONE);
		new Label(group_1, SWT.NONE);
		new Label(group_1, SWT.NONE);
		new Label(group_1, SWT.NONE);
		new Label(group_1, SWT.NONE);

		Button btnCreateEa = new Button(group_1, SWT.NONE);
		GridData gd_btnCreateTpo = new GridData(SWT.LEFT, SWT.CENTER, false,
				false, 1, 1);
		gd_btnCreateTpo.widthHint = 100;
		btnCreateEa.setLayoutData(gd_btnCreateTpo);
		btnCreateEa.setText("Erstellen");
		btnCreateEa.setBounds(0, 0, 44, 25);

		Composite composite = new Composite(parent, SWT.NONE);
		composite.setLayout(new GridLayout(1, false));

		Composite resultTable = new Composite(composite, SWT.NONE);
		resultTable.setBounds(0, 0, 64, 64);
		resultTable.setLayout(new TableColumnLayout());

		TableViewer tableViewer = new TableViewer(resultTable, SWT.BORDER
				| SWT.FULL_SELECTION);
		table = tableViewer.getTable();
		table.setHeaderVisible(true);
		table.setLinesVisible(true);
		// TODO Auto-generated method stub

	}

	@Override
	public void setFocus() {
		// TODO Auto-generated method stub

	}
}
